//
//  WBDomeViewController.swift
//  MyWeibo
//
//  Created by 5201-mac on 2017/4/26.
//  Copyright © 2017年 wlb-mac. All rights reserved.
//

import UIKit

class WBDomeViewController: WBBaseViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // 设置标题
        title = "第\(navigationController?.childViewControllers.count ?? 0)个"
    }
    
    // MARK: - 监听方法
    /// 继续push一个新的控制器
    @objc fileprivate func showNext() {
        let vc = WBDomeViewController()
        
        navigationController?.pushViewController(vc, animated: true)
    }

}

extension WBDomeViewController {
    
    /// 重写父类方法
    override func setupTableView() {
        super.setupTableView()
        
        // 设置右侧的控制器
        //navigationItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", style: .plain, target: self, action: #selector(showNext))
        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", target: self, action: #selector(showNext))
    }
    
}
